package com.bytecodezz.app.sketch.main.ui.home

import android.graphics.Color
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.lifecycle.ViewModelProvider
import com.bytecodezz.app.sketch.common.base.BaseUIFragment
import com.bytecodezz.app.sketch.main.model.MainFragmentViewModel
import com.bytecodezz.app.sketch.main.model.LauncherUIViewModel
import com.bytecodezz.app.base.framework.base.model.BaseViewModel
import com.bytecodezz.app.base.framework.tools.StatusBarTools
import com.bytecodezz.app.sketch.main.databinding.MainFragmentMainBinding

/**
 * app实际首页主体内容 控制底部菜单切换和主页面显示
 */
class MainFragment : BaseUIFragment<MainFragmentMainBinding, MainFragmentViewModel>() {


    override fun initOtherObserver() {
        super.initOtherObserver()
    }

    override fun onCreateViewBinding(
        inflater: LayoutInflater,
        container: ViewGroup?,
        savedInstanceState: Bundle?
    ) = MainFragmentMainBinding.inflate(inflater, container, false)

    override fun onActivityViewModelProvider(): BaseViewModel? {
        return activity?.let { ViewModelProvider(it).get(LauncherUIViewModel::class.java) }
    }

    override fun onCreateViewModelClass() = MainFragmentViewModel::class.java

    override fun onActionStart(contentView: View) {
        super.onActionStart(contentView)
        StatusBarTools.setStatusBarColor(requireActivity(), Color.parseColor("#212121"), false)
    }
}
